package ast;

import compiler.OutputFormatter;

public class ReturnStatement extends Statement {
	
	private Expression expression;

	public ReturnStatement(Expression expression) {
		this.setExpression(expression);
	}

	public void setExpression(Expression expression) {
		this.expression = expression;
	}

	public Expression getExpression() {
		return expression;
	}
	
	@Override
	public void genC(OutputFormatter of) {
		of.output("return ");
		expression.genC(of);
		super.genC(of);
	}

}
